{extend name="public/layout"}
{block name="title"}我的资料{/block}
{block name="head"}
<style>
    html, body {
        background-color: #f5f5f5;
    }

    .big-icon {
        height: 0.3648rem !important;
        width: 0.3648rem !important;
    }

    .btn-block-area{
        margin-top: 2rem;
    }

</style>
{/block}
{block name="content"}
{notempty name="error"}
<div class="text-center h0 text-danger panel">
    {$error}
</div>

{else/}
<div class="list bg-white mtl" id="form1">
    <input type="hidden" name="id" value="{$m.id}">
    <div class="list-item border-b border-t flex">
        <img src="/images/icons/company.png" alt="" class="big-icon">
        <label>活动名称:</label>
        <div class="flex-con">
            {if $m.coupon_id==0}
            珊瑚种植保育潜水活动
            {else/}
            珊瑚种植保育潜水培训
            {/if}
        </div>
    </div>
    <div class="list-item border-b flex">
        <img src="/images/icons/faren.png" alt="" class="big-icon">
        <label>活动人数:</label>
        <div class="flex-con">
            <span class="text-primary">{$m.man_num}</span> 人
        </div>

    </div>
    <div class="list-item border-b flex">
        <img src="/images/icons/man2.png" alt="" class="big-icon">
        <label for="username">姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名:</label>
        <div class="flex-con">
            <input type="text" name="username" required id="username" class="form-control" placeholder="请输入姓名">
        </div>

    </div>
    <div class="list-item border-b flex">
        <img src="/images/icons/phone.png" alt="" class="big-icon">
        <label for="telephone">联系电话:</label>
        <div class="flex-con">
            <input type="text" name="telephone" required id="telephone" class="form-control" placeholder="请输入联系电话">
        </div>
    </div>
    <div class="list-item border-b flex">
        <img src="/images/icons/unit2.png" alt="" class="big-icon">
        <label for="workplace">工作单位:</label>
        <div class="flex-con">
            <input type="text" name="workplace" required id="workplace" class="form-control" placeholder="请输入工作单位">
        </div>
    </div>
</div>
<div class="btn-area btn-block-area">
    <div class="btn-block btn-primary btn-rounded" id="submit">确认提交</div>
</div>

{:_js('js/phone.js')}
<script>
    $('#submit').on('click', function () {
        c.form('form1', "{:U('doApply')}").validate().submit().success(function () {
            location.href = "{:U('applyResult',['t'=>$m.coupon_id])}";
        });
    });
</script>

{/notempty}
{/block}

